<img src='partials/TestDataXY_SineCurve.PNG' style='width:400px;float:right'>
<div>
<pre>
<span class='code_snippet' style='font-size: 11px'>

ArrayList&lt;XYDataSeries&gt; xySeriesList = new ArrayList&lt;XYDataSeries&gt;();

ArrayList&lt;DataPoint&gt; values = new ArrayList&lt;DataPoint&gt;();

for (int x = -170; x &lt;= 170; x++) {
values.add(new DataPoint(x, (int) (50 * sin((x / 100.0) * 2
* Math.PI))));
}

ArrayList&lt;DataPoint&gt; values3 = new ArrayList&lt;DataPoint&gt;();

for (int x = -170; x &lt;= 170; x++) {
DataPoint dp = new DataPoint(x, (int) (50 * cos((x * 10 / 100.0)
* 2 * Math.PI)));

values3.add(dp);
}


XYDataSeries series = new XYDataSeries(null,
new Line(Color.BLUE), "x^2");


series.dataPoints = values;

XYDataSeries series3 = new XYDataSeries(

new UIPointCircle(Color.PINK, 1), new Line(Color.PINK), "e^x");

series3.dataPoints = values3;

xySeriesList.add(series);
xySeriesList.add(series3);

XAxis xAxis = new XAxis(new LinearNumericalAxisScaling(), "X");
xAxis.axisScaling.setMinValue(0);
xAxis.axisScaling.setMaxValue(400);

XYChart chart = new XYChart("Sine/Cos Curve", "x", "y", xySeriesList);// ,
// yAxis,
// xAxis);

chart.xAxis = xAxis;

</span></pre></div>